<?php

include _ITSTOCK_INCLUDE_DIR_.'html_search.inc.php';
include _ITSTOCK_INCLUDE_DIR_.'html_message.inc.php';
include _ITSTOCK_INCLUDE_DIR_.'html_navigation.inc.php';
include _ITSTOCK_INCLUDE_DIR_.'html_menu.inc.php';
include _ITSTOCK_INCLUDE_DIR_.'html_table_list.inc.php';
include _ITSTOCK_INCLUDE_DIR_.'settings_html.inc.php';

$itstock_page_info['css'] = array('main.css', 'aside.css', 'float_menu.css', 'page.css', 'table.css', 'lightbox.css', 'form_save.css');
$itstock_page_info['js'] = array('common.js', 'ajax.js', 'request.js', 'lightbox.js', 'search.js', 'settings.js');
$itstock_page_info['title'] = 'Warranty Settings - IT Stock Tool';
$itstock_page_info['menu_title'] = 'Warranty Settings';
$itstock_page_info['menu_items'] = array(
  '<label onclick="itstock_page_request(\'add_warranty\')">New Warranty</label>',
  '<label onclick="itstock_page_request(\'add_measure\')">New Measure</label>'
);
$itstock_page_info['search_page'] = 'warranty';

$_SESSION['on_delete']['warranty'] = $_SERVER['REQUEST_URI'];
$_SESSION['on_save']['warranty'] = $_SERVER['REQUEST_URI'];
$_SESSION['on_delete']['measure'] = $_SERVER['REQUEST_URI'];
$_SESSION['on_save']['measure'] = $_SERVER['REQUEST_URI'];

$structure = itstock_html_search_init('warranty');
$structure['table_headers'] = array('Warranty', '', '');
$structure['table_indexes'] = array('warranty_measure');
$structure['table_actions'] = array(
  '<img src="img/edit.png" onclick="itstock_page_request(\'add_warranty\', \'%s\')" title="Edit">',
  '<a href="delete.php?type=warranty&id=%s"><img src="img/delete.png" title="Delete"></a>'
);
$structure['table_error'] = 'No warranties have been found.';

itstock_html_base_header($itstock_page_info);
echo '<div class="aside">';
itstock_settings_menu();
echo '</div>';
echo '<div class="bside">';

itstock_html_menu_search($itstock_page_info);
echo '<table>';
itstock_html_table_list_data($structure, false);
echo '</table>';

/* Measures */
echo '<br><br><b>Available Measures</b><br><table>';
itstock_structure($measures, 'measure');
$measures['table_headers'] = array('N&deg;', 'Measures', '', '');
$measures['table_indexes'] = array('measure');
$measures['table_actions'] = array(
  '<img src="img/edit.png" onclick="itstock_page_request(\'add_measure\', \'%s\')" title="Edit">',
  '<a href="delete.php?type=measure&id=%s"><img src="img/delete.png" title="Delete"></a>'
);
$measures['table_error'] = 'No measures have been found.';
$measures['limit'] = '';
itstock_html_table_list_data($measures, true, false);
echo '</table>';
echo '</div>';
itstock_html_base_footer();
?>
